package com.coderknock.bbs.web.controller

import com.coderknock.bbs.mybatis.domain.User
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping

/**
 * <p></p>
 * @author 三产
 * @version 1.0
 * @date 2017-12-01
 * @QQGroup 213732117
 * @website http://www.coderknock.com
 * @copyright Copyright 2017 拿客 coderknock.com  All rights reserved.
 * @since JDK 1.8
 */
@Controller
class TestController {
    @GetMapping("/admin/test")
    fun admin() = "case/case"

    @GetMapping("/reader/test")
    fun reader() = "user/home"

    @GetMapping("/TestUpload")
    fun TestUpload() = "index"

    @GetMapping("/add")
    fun add() = "jie/add"

    @PostMapping("/add")
    fun add(content: String, title: String): String {
//        var user = SecurityContextHolder.getContext().authentication.principal as User
        println(" 帖子内容 $content 标题 $title")
        return "index"
    }

}